<!--督导评教-->
<template>
  <div class="wrapper-container">
    <div class="search-container">
      <div class="search-container-left">
        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
          <el-form-item label="学期" prop="xq">
            <el-select v-model="queryParams.xueqi" style="width: 90px" placeholder="选择学期" clearable size="mini">
              <el-option
                v-for="item in xqList"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" style="background-color: rgb(241 248 254); color: rgb(81 174 246); font-size: 12px;" @click="handleQuery">查询</el-button>
          </el-form-item>
        </el-form>
      </div>

      <div class="search-container-item" style="margin-top:10px" >
        学员可以查看自己评价的"教员-课程"  (总: {{many}}个) 前50%的名单:
      </div>
    </div>
    <div class="table-container">
      <el-table
        tooltip-effect="light"
        :data="tableData"
        border
        style="width: 100%"
        class="table-data"
        row-class-name="row-class"
        cell-class-name="cell-class"
        header-row-class-name="header-row-class"
        header-cell-class-name="header-cell-class"
      >
        <el-table-column prop="coursename" label="课程名称" width="834px" align="center">
        </el-table-column>
        <el-table-column prop="teachername" label="上课教员" width="834px" align="center">
        </el-table-column>
      </el-table>
    </div>
    <div class="bottom-block">
      <div class="text">授课教员名字后加“*”为课程负责人</div>
    </div>
  </div>
</template>

<script>
import { evaResurt1} from "../../../api/courseExame/stuEvaTea";

export default {
  data() {
    return {
      queryParams: {
        studentid: "",
        xueqi: "2021春",
      },
      showSearch: true,
      currentCell: "",
      // xq: "2021春",
      xqList: [
        {
          value: "2021春",
          label: "2021春",
        },
        {
          value: "2020夏",
          label: "2020夏",
        },
      ],
      many:'',
      tableData: [
        {
          teachername: "李教员",
          coursename: "计算机",
          classes: "教学一班",

        },
      ],
    };
  },
  created() {
    this.evaResLook1();
  },
  methods: {
    evaResLook1(){
      evaResurt1(this.queryParams).then(res => {
        this.tableData = res.data.data.pjEvalactors;
        this.many =res.data.data.many;
        console.log("==================="+this.tableData.many)
      })
    },

    handleQuery(){
      // this.evaResLook();
      //查询到数据进行回显，有数据显示，没数据就是空的
      evaResurt1(this.queryParams).then(res => {
        this.tableData = res.data.data.pjEvalactors;
        this.many =res.data.data.many;
        console.log("==================="+this.tableData.many)
      })
    },


    dealCommonn(item) {
      return item.substring(0, 36) + "...";
    },
    cellMouseEnter(index) {
      this.currentCell = index;
    },
    cellLeave() {
      this.currentCell = "";
    },
  },
};
</script>
<style lang="less" scoped>
.table-container {
  margin-top: 30px;
  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }
  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }
  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }
  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    > div {
      margin-bottom: 8px;
    }
  }
  .search-button {
    cursor: pointer;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 27px;
    background: #f1f8fe;
    border: 1px solid #51aef6;
    border-radius: 6px;

    > span {
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #51aef6;
    }
    > img {
      width: 19px;
      height: 19px;
      margin-right: 4px;
    }
  }
  .edit-button {
    .search-button;
    background: #dfffef;
    border: 1px solid #02c86c;
    > span {
      color: #02c86c;
    }
  }
}
</style>

<style lang="less" scoped>
@import "../../../styles/supervision.less";
.wrapper-container .search-container[data-v-0b21611f] {
  margin-top: 27px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.search-container-right{
  display: flex;
  margin-top: 20px;
  width: 593px;
  height: 26px;
  font-size: 20px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #004CA7;
  opacity: 1;
}

.table-container {
  margin-top: 30px;
  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}
</style>
